<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>margin负值之美的使用</title>
    <style>
        /*1.盒子定位居中*/
        .middle-position {
            position: relative;
            width: 200px;
            height: 200px;
            background-color: pink;
            margin: 100px auto;
        }
        .son {
            position: absolute;
            left: 50%;
            margin-left: -10px;
            width: 20px;
            height: 20px;
            background-color: purple;
        }
        /*2.压住盒子的相邻边框*/
        .two {
            position: relative;
            float: left;
            width: 200px;
            height: 350px;
            margin-left: -1px;
            border:1px solid pink;
        }
        .two:hover {
            border:1px solid black;
            z-index: 1;
        }
    </style>
</head>
<body>
<div class="middle-position">
    <div class="son"></div>
</div>
<div class="father">
    <div class="two">
    </div>
    <div class="two">
    </div>
    <div class="two">
    </div>
    <div class="two">
    </div>
    <div class="two">
    </div>
</div>

</body>
</html>